1. Field of the Invention
Methods and apparatuses consistent with the present invention relate to displaying video data, and more particularly, to displaying video data without displaying delay in a video decoder which cannot judge the end of a picture.
2. Description of the Related Art
According to the Motion Pictures Expert Group-2 (MPEG-2) video standard, a starting code to recognize the start of a picture exists, but an end code to recognize the end of a picture does not exist. This is because a decoder rarely finds the end of a picture in an elementary stream (ES). Accordingly, a conventional hardware MPEG-2 decoder generally does not recognize the end of a picture, and instead recognizes a header of a next picture or the end of a stream. The end of a stream is identified by a Sequence End Code (SEC) or an End Of Sequence (EOS) code. Based on the recognized data, the MPEG-2 decoder displays a decoded picture on a screen.
Here, the SEC or the EOS code are referred to as the end of a video stream. For video data based on the MPEG-1 or MPEG-2 formats, the term SEC is used and for video data based on the video codec 1 (VC1) and H.264 formats, the term EOS is used.
Video data is formed of several minutes or hours of streams and is successively displayed in most applications. In this case, video is displayed whenever a decoder recognizes a picture starting code. However, in the case of a stream having a large video gap such as a menu screen formed of one picture and a slide show application, decoded video data is stored in a buffer but cannot be displayed.
Therefore, a delay having a large difference between the time the menu screen is switched to the slide show application is substantially displayed on a screen until a Presentation Time Stamp (PTS) of a picture may be displayed.
In particular, in the Blu-ray (next generation optical device) standard, a time interval exists between each of a plurality of video browsing units and sometimes is decoded in a scattered manner. In this case, if a conventional MPEG-2 video decoder is used in a blue-ray disk player, a decoded picture in the buffer of the decoder cannot be displayed until the MPEG-2 video decoder recognizes a starting code of a next picture or a SEC/EOS code.
FIG. 1 is a block diagram of a related art MPEG-2 transport stream (TS) data displaying apparatus.
Referring to FIG. 1, the conventional MPEG-2 TS data displaying apparatus includes a demultiplexer 110, a video ES buffer 120, a decoder 130, a decoding buffer selector 140, a video buffer 150, a display buffer selector 160, and a displaying unit 170.
The demultiplexer 110 only parses an MPEG ES in MPEG-TS or MPEG-program script (PS) format and transmits it to the video ES buffer 120.
The video ES buffer 120 stores the MPEG ES parsed in the demultiplexer 110. The stored MPEG ES is transmitted to the decoder 130. In a blue-ray MPEG-TS, the stored MPEG ES is sequentially transmitted to the decoder 130 according to an Arrival Time Stamp (ATS) added to each TS packet of the stored MPEG ES. The video ES buffer 120 is prevented from being overflowed and underflowed according to the ATS
The decoder 130 assembles the MPEG-2 video MPEG ES transmitted from the video ES buffer 120 to complete one picture. In FIG. 1, the decoder 130 refers to an element in which only decoding operations are performed. An MPEG-2 decoding system comprises a plurality of modules required in a data storage space and a decoder and is a super ordinate concept as compared with the decoder 130 illustrated in FIG. 1.
The decoding buffer selector 140 selects a video buffer among the video buffers 152, 153, 154 . . . 15N in the video buffer 150 to store the decoded data and the display buffer selector 160 selects a buffer where data to be displayed is stored. If one picture is completed by assembling the decoded data in the video buffer 150, a pointer in the display buffer selector 160 is incremented causing the display buffer selector 160 to display a next picture.
As illustrated in FIG. 1, the decoding buffer selector 140 and the display buffer selector 160 have a pointer difference equating to one picture and thus, only a picture that is decoded is displayed on a screen.
When a picture is completed by assembling data decoded in the video buffer 150, the display buffer selector 160 has to increase its pointer by 1. Therefore the display unit 170 displays a next picture. According to an operation of the conventional MPEG-2 TS data displaying apparatus illustrated in FIG. 1, the demultiplexer 110 only extracts a video ES from an MPEG-TS or an MPEG-PS stream and stores the video ES in the video ES buffer 120. The decoder 130 reads data required to decode a video ES from the video ES buffer 120. If the decoder 130 recognizes a picture starting code or a SEC/EOS code, the decoder 130 increments pointers of both the decoding buffer selector 140 and the display buffer selector 160 by one.
The decoded data is stored in the video buffer 150. The stored data is completed as one picture and the picture is displayed on a screen when the pointer of the display buffer selector 160 is incremented. The display buffer selector 160 sequentially synchronizes with the decoding buffer selector 140 to be operated and thus only a picture that is decoded is displayed on a screen. Accordingly, a pointer difference between the decoding buffer selector 140 and the display buffer selector 160 should be one.
FIG. 2 is a diagram illustrating an example of an MPEG-2 TS stream when a Presentation Time Stamp (PTS) difference between successive pictures is large.
The MPEG-2 TS stream in FIG. 2 is formed of a first video stream 210, a second video stream 220, a third video stream 230, a fourth video stream 240, and a SEC/EOS code 250. The MPEG-2 TS stream in FIG. 2 has a significantly large PTS difference between the first video stream 210 and the second video stream 220 and is used in a menu. In other words, each of the first through fourth video streams 210 through 240 in FIG. 2 is not successively displayed; instead each of the first through fourth video streams 210 through 240 is used as a separate menu.
As an example, in order to use the first video stream 210 having a PTS value of 0x8000, only a picture of an application with PTS 0x8000 210 is read. Here, the SEC/EOS code 250 does not exist after the first video stream 210 having a PTS value of 0x8000. Therefore, the decoder 130 receives and decodes the first video stream 210 having a PTS value of 0x8000 to store in the video buffer 150 However, the decoder 130 does not recognize a SEC/EOS code or the start of a next video stream. Thus, the decoded first video stream 210 cannot be displayed on a screen. Accordingly, in the related art, if only a video decoder is used without any additional processes, a menu corresponding to the first video stream 210 having a PTS value of 0x8000 cannot be displayed.
FIG. 3 is a diagram illustrating an example of an MPEG-2 video stream in which a video gap exists.
Referring to FIG. 3, the MPEG-2 video stream in which a video gap exists includes a first video stream 310, a second video stream 320, a video gap 330, a third video stream 340, and a SEC/EOS code 350.
The PTS of the first video stream 310 is P1, the PTS of the second video stream 320 is P2, and the PTS of the third video stream 340 is P3.
In the present example, the first video stream 310 is currently being displayed on a screen and the second video stream 320 is being decoded. When decoding of the second video stream 320 is completed, the pointer of the display buffer selector 160 should be increased by 1 in order to display the second video stream 320. However, due to the video gap 330, the third video stream 340 is delayed by delta G1 before being recognized by the decoder 130. The video gap 330 in FIG. 3 may correspond to user supplementary service data. The user supplementary service data is generated when user is trying to interrupt on displaying picture. For instance, the user supplementary service data is generated when user load pop-up frame to control reproducing speed or volume on displaying picture.
Until the third video stream 340 reaches the decoder 130, the first video stream 310 is continuously displayed. Ultimately, until the third video stream 340 is input to the decoder 130, the second video stream 320 cannot be displayed and waits in a state indicating that only decoding is completed.
Such time delay may prevent the video data from being displayed in a synchronized fashion. Such a problem is often generated in reproducing a time-based slideshow or a browsable slideshow of a blue-ray disk player in which an MPEG-TS stream including an ATS is used.
As described above, a conventional decoder cannot recognize the end of a picture and instead recognizes only a picture header or a SEC/EOS code. Thus, in the case of a menu screen formed of only one picture and a stream which includes the menu screen has a large video gap, or when only a part of an input stream is displayed, decoded video data is stored in a buffer and not displayed in a synchronized fashion, thereby causing delay.